package com.lingyun.mqttserver.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {

    private boolean success;

    private Integer code;

    private String message;

    private Object data;

    public static Result success(Object data){
        return new Result(true,200,"success", data);
    }

    public static Result fail(Integer code, String msg){
        return new Result(false,code,msg,null);
    }
}